from selenium.webdriver.common.by import By

from Common.Utils import BlogDriver
#博客首页测试用例
class BlogList:
    url = ""
    driver = ""
    def __init__(self):
        self.url = "http://blog.csdn.net/qq/article/list"
        self.driver = BlogDriver.driver
        self.driver.get(self.url)
    def ListTestBylogin(self):
        # 测试博客标题是否存在
        self.driver.find_element(By.CSS_SELECTOR, "body > div.container > div.right > div.blog-title")

        # 测试博客内容是否存在
        self.driver.find_element(By.CSS_SELECTOR, "body > div.container > div.right > div.blog-content")

        # 测试按钮是否存在
        self.driver.find_element(By.CSS_SELECTOR, "body > div.container > div.right > div.blog-button > button")

        # 测试个人信息昵称是否存在
        self.driver.find_element(By.CSS_SELECTOR, "body > div.container > div.right > div.user-info > span.nickname")





list = BlogList()
list.ListTestBylogin()
